﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Pibby.Core.IO.Tests.Stubs
{
	public class File : IFile
	{
		public File()
		{
			this.Exists = true;
		}

		public File(string path)
			: this ()
		{
			this.Path = path;
		}

		#region Properties

		public string Name
		{
			get { return System.IO.Path.GetFileName(this.Path); }
		}

		public string FolderName
		{
			get { return System.IO.Path.GetDirectoryName(this.Path); }
		}

		public string Path
		{
			get;
			set;
		}

		public long Length
		{
			get;
			set;
		}
		

		public bool Exists
		{
			get;
			set;
		}

		public string NameNoExtension
		{
			get { return string.Empty; }
		}

		public string Extension 
		{
			get { return "mp3"; }
		}

		public DateTime CreationTime 
		{ 
			get { return DateTime.Today.AddDays (-3); } 
		}

		public DateTime LastWriteTime 
		{
			get { return CreationTime.AddDays(1); } 
		}

		public DateTime LastAccessTime 
		{
			get { return DateTime.Today; }
		}

		#endregion Properties

		#region Methods

		public void Delete()
		{
			this.Exists = false;
		}

		#endregion Methods

	}
}
